<template>
  <view class="container">
    <view class="header_txt">
      <view class="back"
            @click="backHandler">
        <image src="/static/img/back3.png"></image>
      </view>
      <view class="title"> 问题反馈 </view>
    </view>
    <view class="content">
      <view class="list_box">
        <view class="list_item"
              @click="goCLogin">
          <view class="list_left">修改登录密码</view>
          <image class="list_r"
                 src="../../static/image/grzx_ico_jr_hui@2x.png"
                 mode=""></image>
        </view>
        <view class="list_item"
              @click="goSetPay"
              v-show="profileinfo.pay_pwd==null">
          <view class="list_left">设置支付密码</view>
          <image class="list_r"
                 src="../../static/image/grzx_ico_jr_hui@2x.png"
                 mode=""></image>
        </view>
        <block v-if="profileinfo.pay_pwd!=null">
          <view class="list_item"
                @click="goCpay">
            <view class="list_left">修改支付密码</view>
            <image class="list_r"
                   src="../../static/image/grzx_ico_jr_hui@2x.png"
                   mode=""></image>
          </view>
          <view class="list_item"
                @click="goFpay">
            <view class="list_left">忘记支付密码</view>
            <image class="list_r"
                   src="../../static/image/grzx_ico_jr_hui@2x.png"
                   mode=""></image>
          </view>
        </block>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      profileinfo: []
    }
  },
  onLoad() {
    this.getUserInfo()
  },
  onShow() {
    this.getUserInfo()
  },
  methods: {
    //user/get_user_info
    async getUserInfo() {
      const { data } = await this.$http.post('/user/get_user_info')
      console.log(data)
      this.profileinfo = data.data
    },
    goCLogin() {
      uni.navigateTo({
        url: 'SetLoginPwd'
      })
    },
    goSetPay() {
      uni.navigateTo({
        url: 'setPayPwd'
      })
    },
    goCpay() {
      uni.navigateTo({
        url: 'ChangePay'
      })
    },
    goFpay() {
      uni.navigateTo({
        url: 'forgetPay'
      })
    },

    backHandler() {
      uni.navigateBack({
        delta: 1
      })
    }
  }
}
</script>

<style lang="scss">
/* 头部区域 */
.header_txt {
  width: 750rpx;
  overflow: hidden;
  height: 88rpx;
  line-height: 88rpx;
  background-color: #fff;

  .back {
    position: absolute;
    top: 14rpx;
    left: 14rpx;
    width: 60rpx;
    height: 60rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    image {
      width: 48rpx;
      height: 48rpx;
    }
  }

  .right {
    position: absolute;
    top: 14rpx;
    right: 14rpx;
    width: 60rpx;
    height: 60rpx;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .title {
    text-align: center;
    height: 88rpx;
    // margin-top: -20rpx;
    // line-height: 88rpx;
    font-size: 32rpx;
    font-weight: bold;
  }
}

.content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f5f5f5;
}

.list_box {
  width: 100%;
  height: auto;
  margin-top: 20rpx;
}

.list_item {
  width: 100%;
  height: 100rpx;
  border-bottom: 1rpx solid #f5f5f5;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30rpx;
}

.list_r {
  width: 12rpx;
  height: 22rpx;
}
</style>